-
Notifications
You must be signed in to change notification settings - Fork 447
Add supporting multi-target dynamic scraping #1120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Dmitry Ponomaryov <[email protected]>
…ndle concurrent access Signed-off-by: Dmitry Ponomaryov <[email protected]>
Signed-off-by: Dmitry Ponomaryov <[email protected]>
Signed-off-by: Dmitry Ponomaryov <[email protected]>
Signed-off-by: Dmitry Ponomaryov <[email protected]>
Signed-off-by: Dmitry Ponomaryov <[email protected]>
Signed-off-by: Dmitry Ponomaryov <[email protected]>
Signed-off-by: Dmitry Ponomaryov <[email protected]>
Signed-off-by: Dmitry Ponomaryov <[email protected]>
Signed-off-by: Dmitry Ponomaryov <[email protected]>
Signed-off-by: Dmitry Ponomaryov <[email protected]>
Signed-off-by: Dmitry Ponomaryov <[email protected]>
any feedback? can be produced |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1120 +/- ##
==========================================
- Coverage 70.88% 63.88% -7.01%
==========================================
Files 28 30 +2
Lines 3569 3162 -407
==========================================
- Hits 2530 2020 -510
- Misses 904 997 +93
- Partials 135 145 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This PR introduces support for multi-target scraping via the
/scrape?target=...
endpoint, even when--mongodb.uri
is configured globally. This allows dynamic discovery and monitoring of MongoDB instances without restarting the exporter, improving integration with Prometheus service discovery and multi-target configurations.https://prometheus.io/docs/guides/multi-target-exporter/
Unlike the previous approach, where scraping was limited to the fixed list of instances specified by
--mongodb.uri
and when need added new host, need restart exported, this change enables flexible, on-demand querying of arbitrary MongoDB targets through the/scrape?target=...
parameter.Related issue: #878 — Multi target without need for specifying --mongodb.uri
Leave notes to the reviewers if you need to focus their attention on something specific:
This change affects core logic related to connection handling and target resolution. Existing setups using
--mongodb.uri
continue to work without changes. At the same time, users can now add dynamic targets seamlessly.If you notice anything that could affect stability or how can do more good with code structure, caching or backward compatibility, especially in edge cases or other contributed rights, please let me know and we fixed this.